﻿using NHibernate.Criterion;

namespace Model.Repositories.Group
{
    public class GroupRepository : Repository<Entities.Group>
    {
        public Entities.Group GetByTitle(string title)
        {
            var obj = Session.CreateCriteria<Entities.Group>().Add(Restrictions.Eq("Title", title)).List<Entities.Group>();
            if (obj != null && obj.Count == 1)
                return obj[0];
            return null;
        }
    }
}
